package com.wanli.storemobile.utils;

import android.content.Context;

import com.wanli.storemobile.MyApplication;


/**
 */

public class Dp2Px {

    public static float dp2Px(Context context, float dp) {
        float scale = context.getApplicationContext().getResources().getDisplayMetrics().density;
        return (dp * scale + 0.5f);
    }

    public static float dp2Px(float dp) {
        float scale = MyApplication.getContext().getResources().getDisplayMetrics().density;
        return (dp * scale + 0.5f);
    }
}
